<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            position: relative;
            width: 300px;
            height: 200px;
            background-color: antiquewhite;
        }

        .content {
            width: fit-content;
            height: fit-content;
            background-color: rgb(226, 225, 228);
            box-sizing: border-box;
            position: absolute;
            right: 0;
            bottom: 0;
            top: 0;
            left: 0;
            margin: auto; /* 关键 */
            text-align: center;
        }

        .show {
            bottom: 0;
        } 

    </style>
</head>

<body>
    <div class="box">
        <div class="content">您有23条业务消息！</div>
    </div>
</body>

</html>